"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const components_1 = require("@tarojs/components");
const react_1 = require("react");
const taro_1 = require("@tarojs/taro");
const taro_ui_1 = require("taro-ui");
require("./certification.scss");
const Certification = () => {
    // 标签页将认证页面分成两个模块6
    const tabList = [{ title: '个人认证' }]; //, { title: '企业认证' }]
    const [current, setCurrent] = react_1.useState(0);
    const [realName, setName] = react_1.useState('');
    const [identityId, setIdentifyID] = react_1.useState('');
    const [phone, setPhone] = react_1.useState('');
    const handleClick = (value) => {
        setCurrent(value);
    };
    const [state, setState] = react_1.useState({ value: '' });
    // const value=state;
    const handleChange = (value) => {
        () => { setState(value); };
        return "value";
    };
    const Save = () => {
        const obj = {
            realName,
            phone,
            identityId,
        };
        try {
            taro_1.default.cloud.callFunction({
                name: "logins",
                data: {
                    $url: "addReal",
                    data: obj,
                }
            });
        }
        catch (err) {
            console.log(err);
        }
    };
    return (<components_1.View className='index'>
        
        <taro_ui_1.AtTabs current={current} tabList={tabList} onClick={handleClick}>
        
            <taro_ui_1.AtTabsPane current={current} index={0}>
            <components_1.View className='personId'>
                <taro_ui_1.AtInput name='value' title='姓名' placeholder='请输入您的姓名' value={realName} onChange={(res) => setName(res)}/>
                <taro_ui_1.AtInput name='value' title='身份证号' type='phone' placeholder='请输入您的身份证号' value={identityId} onChange={(res) => setIdentifyID(res)}/>
                <taro_ui_1.AtInput name='value' title='手机号' placeholder='请输入您的手机号' value={phone} onChange={(res) => setPhone(res)}/>
                <taro_ui_1.AtInput name='value' title='验证码' placeholder='请输入验证码' value={state.value} onChange={handleChange}>
                    <components_1.View>发送验证码</components_1.View>
                </taro_ui_1.AtInput>
                <taro_ui_1.AtButton className='preservation' onClick={Save}>保存</taro_ui_1.AtButton>
                
            </components_1.View>
            </taro_ui_1.AtTabsPane>
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        </taro_ui_1.AtTabs>


    </components_1.View>);
};
exports.default = Certification;
//# sourceMappingURL=certification.jsx.map